package com.stream.mq;

import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Source;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.support.MessageBuilder;

import javax.annotation.Resource;

@EnableBinding(Source.class)
public class PaymentProvider {

    @Resource
    private MessageChannel output;

    public boolean send(String messageString) {
        Message<String> message = MessageBuilder.withPayload(messageString).build();
        return output.send(message);
    }
}
